package com.tjetc.controller;

import com.tjetc.domain.Detail;
import com.tjetc.domain.Detail1;
import com.tjetc.domain.Type;
import com.tjetc.domain.TypeDetail;
import com.tjetc.service.DetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("detail")
public class DetailsController {
    @Autowired
    private DetailService detailService;
    @RequestMapping("findAllDetail")
    public List<Detail> findAllDetail(){
        List<Detail> list = detailService.findAllDetail();
        System.out.println("list = " + list);
        return list;
    }
    @RequestMapping("findAllDetail2")
    public List<Detail> findAllDetai2(){
        List<Detail> list = detailService.findAllDetail2();
        System.out.println("list = " + list);
        return list;
    }
    @GetMapping("findAllDetail3/{name}")
    public List<TypeDetail>  findAllDetail3(@PathVariable String name){
        List<TypeDetail>  list= detailService.lookforIntroduceByid3(name);
        System.out.println("list = " + list);
        return list;
    }
    @RequestMapping("findAllDetail1")
    public List<TypeDetail> findAllDetail1(){
        List<TypeDetail> list = detailService.findAllDetail1();
        System.out.println("list = " + list);
        return list;
    }
    @RequestMapping("lookforDetail1Byname/{name}")
    public List<Detail> lookforDetail1Byname(@PathVariable String name){
        List<Detail> list = detailService.lookforDetail1Byname(name);
        System.out.println("list = " + list);
        return list;
    }
}
